package com.zx.onlineeducation.service.edu.controller;

import com.zx.onlineeducation.common.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 后台管理系统登录 前端控制器
 *
 * @author 郑雪
 * @since 2022-01-10
 */
@Api(tags = "用户管理")
@RestController
@RequestMapping("/edu/user")
@CrossOrigin // 解决跨域
public class LoginController {

    @ApiOperation("登录")
    @PostMapping("/login")
    public R login() {
        return R.ok().data("token", "admin");
    }

    @ApiOperation("获取用户信息")
    @GetMapping("/info")
    public R info() {
        return R.ok().data("roles", "[admin]").data("name", "admin").data("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
    }
}
